Skip to content

KBE3D / KBCore / Cesium / SvgPathBindingHandler

SvgPathBindingHandler

A Knockout binding handler that creates a DOM element for a single SVG path. This binding handler will be registered as cesiumSvgPath.

<p> The parameter to this binding is an object with the following properties: </p>

<ul> <li>path: The SVG path as a string.</li> <li>width: The width of the SVG path with no transformations applied.</li> <li>height: The height of the SVG path with no transformations applied.</li> <li>css: Optional. A string containing additional CSS classes to apply to the SVG. 'cesium-svgPath-svg' is always applied.</li> </ul>

示例

ts
// Create an SVG as a child of a div
<div data-bind="cesiumSvgPath: { path: 'M 100 100 L 300 100 L 200 300 z', width: 28, height: 28 }"></div>

// parameters can be observable from the view model
<div data-bind="cesiumSvgPath: { path: currentPath, width: currentWidth, height: currentHeight }"></div>

// or the whole object can be observable from the view model
<div data-bind="cesiumSvgPath: svgPathOptions"></div>

函数

函数描述
register-

KBE3D @3.0.0 Copyright © 2024-present KBE3D